//==========================================================================
// Copyright (c) 2000-2008,  Elastos, Inc.  All Rights Reserved.
//==========================================================================
#ifndef __AUDIO_H
#define __AUDIO_H
#ifdef __cplusplus
#define EXTERN_C extern "C"
#else
#define EXTERN_C extern
#endif

//#define DEBUG_AUDIO
int kprintf(const char *,...);

#define CODEC_POWERDOWN 0x8000

#define I2SFS_48K           0
#define I2SFS_44K           1
#define I2SFS_32K           2
#define I2SFS_24K           3
#define I2SFS_22K           4
#define I2SFS_16K           5
#define I2SFS_12K           6
#define I2SFS_11K           7
#define I2SFS_8K            8

#define MON	0x1
#define MIC	0x0
#define LLINE	0x1
#define RLINE	0x2
#define BLINE	0x3
#define MAIN_MIC	0x11
#define AUX_MIC		0x22

#define MIC_CHOICE_GPIO56	(1<<24)
#define AMP_PWRENB      (1<<25) // GPIO pin
#define SPKPA_SHUTDOWN	(1<<27) // GPIO pin

EXTERN_C void AUDIO_SetFrequence(unsigned long dwFrequence);
EXTERN_C void AUDIO_Init(void);
EXTERN_C void PrePlay(int mon);
EXTERN_C void PreRecord(int source, int mic, int mic_gain);
EXTERN_C void AftPlay();
EXTERN_C void AftRecord();
EXTERN_C void AUDIO_SetVolume(unsigned char leftVol, unsigned char rightVol, unsigned long bMute);
EXTERN_C void OpenSpeaker(void);
EXTERN_C void CloseSpeaker(void);
#endif
